home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / program / ddj0897.zip / DYN401.ZIP / class / array2.h < prev    next >
Text File  |  1996-02-04  |  1KB  |  64 lines

  1.  
  2.  
  3.  
  4. /*                                      
  5.  *
  6.  *      Copyright (c) 1993-1996 Algorithms Corporation
  7.  *      3020 Liberty Hills Drive
  8.  *      Franklin, TN 37067
  9.  *
  10.  *      ALL RIGHTS RESERVED.
  11.  *
  12.  *      
  13.  *      
  14.  */
  15.  
  16.  
  17.  
  18.  
  19. /* The next three lines are used to define the type used for indexing  */
  20.  
  21. #define INDEX_TYPE    unsigned 
  22.  
  23. #if defined(unix)  ||  defined(M_I386)
  24. #define AT_INDEX    AT_LONG
  25. #define PRNT_SHAPE    "%u "
  26. #else
  27. #define AT_INDEX    AT_USHT
  28. #define PRNT_SHAPE    "%hu "
  29. #endif
  30.  
  31. #define BITS_PER_BYTE    8
  32. #define BIT_VAL(x,y) (((char *) (x))[(INDEX_TYPE) (y) / (INDEX_TYPE) BITS_PER_BYTE] & pow1[(INDEX_TYPE) (y) % (INDEX_TYPE) BITS_PER_BYTE])
  33.  
  34. #define    SET_BIT(p,off,val)    if (val)                   \
  35.     ((char *) (p))[off / BITS_PER_BYTE] |= pow1[off % BITS_PER_BYTE];   \
  36.         else                               \
  37.     ((char *) (p))[off / BITS_PER_BYTE] &= pow2[off % BITS_PER_BYTE]
  38.  
  39. /*  Returns the size of the data portion of an array  */
  40.  
  41. #define SIZE(type,n)  (type != AT_BIT ? (INDEX_TYPE) _A_esize(type) * n    \
  42.                       : (n ? (n+(BITS_PER_BYTE-1)) / BITS_PER_BYTE : 0L))
  43.  
  44.  
  45. typedef    unsigned short _ushort;
  46.  
  47.  
  48.  
  49.  
  50. /*                                      
  51.  *
  52.  *      Copyright (c) 1993-1996 Algorithms Corporation
  53.  *      3020 Liberty Hills Drive
  54.  *      Franklin, TN 37067
  55.  *
  56.  *      ALL RIGHTS RESERVED.
  57.  *
  58.  *      
  59.  *      
  60.  */
  61.  
  62.  
  63.  
  64.